Using the Sentiment Score Plugin
The Sentiment score plugin is only available as a transformation step; it is not available as a Job plugin.
Procedure
- To start Spoon, navigate to your Kettle directory and run spoon.bat.
- Create a new Transformation (File >
New >
Transformation).
- In the
Design tab, select the
Alterian category, select the
Sentiment score plugin and drag it to the transformation panel.
- In the
Design tab, select a source of string data from the
Input category. The examples shown below use a Data Grid step.
- Configure the Data Grid tool with one field of type String on the
Meta tab. In the example, it is called "Message".
- Populate the
Data tab with as many messages as required. The messages can be any length, but the sentiment score will be the sum of the keywords matched for each message.
Note: You can replace the Data Grid with any other step that generates a string field, such as an input CSV step.
- Add a
Text file output step from the
Output category to view the score.
- Join the Data Grid to the Sentiment score step, and the Sentiment score step to the Text file output step.
- Open the Sentiment score step, and select the field to score that contains your message from the
Field to score drop-down. The field is called "Message" in this example.
- Open the Text file output step and select the fields to output, and a location to write the file to.
- To generate more accurate results, select the
Use Online Service check box.
This is a free online service called "Textalytics Sentiment Analysis1.2". The service uses advanced natural language processing techniques to detect the polarity associated to both entities and concepts in the text.
- You can get the API key from textalytics.com. Note that the service is free up to 500,000 requests per month; you will be charged if you require more requests.
Results
Your initial transformation should look like this:
When you run the transformation, a text file containing the sentiment scores is written. This example transformation is available as
example.ktr:
|
|